#nn666666include <iostream>
#include <iomanip>
using namespace std;

class Complex {
	private:
		double real;
		double imaginary;

	public:
		Complex() : real(0), imaginary(0) {}

		Complex(double r, double i) : real(r), imaginary(i) {}

		void setRealPart(double r) {
			real = r;
		}

		void setImaginaryPart(double i) {
			imaginary = i;
		}

		Complex add(const Complex &other) const {
			return Complex(real + other.real, imaginary + other.imaginary);
		}

		Complex sub(const Complex &other) const {
			return Complex(real - other.real, imaginary - other.imaginary);
		}

		void print() const {
			cout << fixed << setprecision(1);
			if (real == 0 && imaginary == 0) {
				cout << "0.0";
			} else if (imaginary == 0) {
				cout << real;
			} else if (real == 0) {
				cout << imaginary << "i";
			} else if (imaginary > 0) {
				cout << real << "+" << imaginary << "i";
			} else {
				cout << real << imaginary << "i";
			}
		}
};

int main() {
	Complex a, b;
	double realA, imaginaryA;
	cin >> realA >> imaginaryA;
	a.setRealPart(realA);
	a.setImaginaryPart(imaginaryA);

	double realB, imaginaryB;
	cin >> realB >> imaginaryB;
	b.setRealPart(realB);
	b.setImaginaryPart(imaginaryB);

	a.print();
	cout << endl;
	b.print();
	cout << endl;

	Complex sum = a.add(b);
	Complex diff = a.sub(b);

	sum.print();
	cout << endl;
	diff.print();
	cout << endl;

	return 0;
}